package Demo_0318;

import java.lang.reflect.Array;
import java.util.*;

/**
 * @author:zhengyilong
 * @email:1797344574@qq.com
 * @phone:13479394730
 * @desc:
 * @DateTime:2022/3/18 9:19
 **/
public class Main extends Father{
    public static void main(String[] args) {
        Demo1 demo1 = new Demo1();
        demo1.Per("张飒",'男',45);

        Demo2 demo2 = new Demo2();
        demo2.Per("李四",'男');

        ArrayList list = new ArrayList();
        list.add(1);
        list.add(2);
        list.add(3);
        list.add(4);
        System.out.println(list);
        Iterator iterator = list.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
            iterator.remove();
        }
        System.out.println(list);

        HashSet hashSet = new HashSet();
        hashSet.add(11);
        hashSet.add(22);
        hashSet.add(33);
        hashSet.add(44);
        Iterator iterator1 = hashSet.iterator();
        while (iterator1.hasNext()){
            System.out.println(iterator1.next());
            iterator1.remove();
        }
        System.out.println(hashSet);

        TreeSet set = new TreeSet();
        set.add(111);
        set.add(222);
        set.add(333);
        set.add(444);
        Iterator iterator2 = set.iterator();
        while (iterator2.hasNext()){
            System.out.println(iterator2.next());
            iterator2.remove();
        }
        System.out.println(set);

        HashMap hashMap = new HashMap();
        hashMap.put("1","上三");
        hashMap.put("2","上的");
        hashMap.put("3","上分为");
        hashMap.put("4","上丰富");
        Set set1 = hashMap.keySet();
        Iterator iterator3 = set1.iterator();
        while (iterator3.hasNext()){
            Object next = iterator3.next();
            Object o = hashMap.get(next);
            System.out.println(next+"："+o);
        }

    }
}

